import React from 'react'
import { Icon } from 'antd'
import './style.scss'
import QueueAnim from 'rc-queue-anim'
import { LoadingComponentProps } from 'react-loadable'

export const Loading: React.FC<LoadingComponentProps> = (props: LoadingComponentProps) => {
    if (!props.pastDelay) {
        return null
    } else {
        return (
            <div className={'loading-box'}>
                <QueueAnim delay={100} duration={1000}>
                    <Icon type="loading" style={{ fontSize: 40, margin: 'auto' }} key={'icon'} spin/>
                    <p key={'icon-text'}>加载中...</p>
                </QueueAnim>
            </div>
        )
    }
}
